export function debounce(func, timeout) {
  let timer
  return function (e) {
    timer && clearTimeout(timer)
    timer = setTimeout(() => {
      func(e)
    }, timeout)
  }
}
